package com.baidu.mapsdkexample.routeplan;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.baidu.mapsdkexample.R;

import java.util.List;

public class OneDayPlanAdapter extends ArrayAdapter<String>{

    private int resourceId;
    public OneDayPlanAdapter(@NonNull @android.support.annotation.NonNull Context context, int resource, @NonNull @android.support.annotation.NonNull List<String> objects) {
        super(context, resource, objects);
        resourceId=resource;
    }

    @NonNull
    @android.support.annotation.NonNull
    @Override
    public View getView(int position, @Nullable @android.support.annotation.Nullable View convertView, @NonNull @android.support.annotation.NonNull ViewGroup parent) {
        View view= LayoutInflater.from(getContext()).inflate(resourceId,parent,false);
        TextView textView=view.findViewById(R.id.nodeText);
        textView.setText(getItem(position));
        return view;
    }
}